package practice3;

import java.util.Scanner;

public class P8707 {


    private static int n;
    private static int m;
    private static int count=0;
    private static int[] xArr = {0,1};
    private static int[] yArr = {1,0};
    public static void dfs(int x,int y){
        if((x>n||y >m) || (x%2==0 && y%2==0)){
            return;
        }
        if(x==n && y==m){
            count++;
            return;
        }
        for(int i=0;i<2;i++){
            int dx = x+xArr[i];
            int dy = y+yArr[i];
            dfs(dx,dy);
        }
    }


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        n=sc.nextInt();
        m=sc.nextInt();
        dfs(1,1);
        System.out.println(count);

    }
}
